WTL Controls
|
Back to the WTL Controls Home Page. |
A CEdit descendant, providing custom focused and non-focused colors via WM_CTLCOLOR variants. More...
#include <EditPlus.h>
Public Member Functions | |
CEditPlus () noexcept | |
virtual | ~CEditPlus () |
void | SubclassEdit (HWND hWnd) |
Subclass an edit control and create GDI objects. More... | |
void | UnSubclassEdit () |
Un-subclass the window and release GDI resources. More... | |
void | SetBackColor (COLORREF value) |
Select a new background color used when the control does not have focus. More... | |
COLORREF | GetBackColor () const |
Default: COLOR_WINDOW . More... | |
void | SetTextColor (COLORREF value) |
Select a new text color used when the control does not have focus. More... | |
COLORREF | GetTextColor () const |
Default: COLOR_WINDOWTEXT . More... | |
void | SetFocusedBackColor (COLORREF value) |
Select a new background color used when the control has focus. More... | |
COLORREF | GetFocusedBackColor () const |
Default: COLOR_WINDOW . More... | |
void | SetFocusedTextColor (COLORREF value) |
Select a new text color used when the control has focus. More... | |
COLORREF | GetFocusedTextColor () const |
Default: CLR_RED . More... | |
void | EnableFloatingPointMode (bool enabled) |
Change the Floating Point Mode state. More... | |
bool | IsFloatingPointModeEnabled () const |
Default: false . More... | |
void | EnableNotifyOnCR (bool value) |
Change the 'Notify on CR' state. More... | |
bool | IsNotifyOnCREnabled () const |
Default: true . More... | |
A CEdit descendant, providing custom focused and non-focused colors via WM_CTLCOLOR variants.
A CEdit with custom colors and which sends an optional custom message (WM_EDITP_EDIT_END) when the user hits VK_RETURN. It also supports a 'Floating Point Mode', that will allow for numerical data entry, including a decimal point, negative sign and the base 10 exponent operator 'E'.
The parent dialog must reflect WM_CTLCOLOREDIT (or WM_CTLCOLORSTATIC, if the control is read-only) messages to the control. Use either the non-discriminating REFLECT_NOTIFICATIONS_EX, or with something more selective (e.g, REFLECT_NOTIFICATIONS_MSG_FILTERED).
Typical usage is depicted below.
Definition at line 46 of file EditPlus.h.
|
noexcept |
Definition at line 26 of file EditPlus.cpp.
|
virtual |
Definition at line 41 of file EditPlus.cpp.
void BIS_WTL_CONTROLS::CEditPlus::SubclassEdit | ( | HWND | hWnd | ) |
Subclass an edit control and create GDI objects.
hWnd | The window handle of the edit control to subclass. |
void |
Definition at line 57 of file EditPlus.cpp.
void BIS_WTL_CONTROLS::CEditPlus::UnSubclassEdit | ( | ) |
Un-subclass the window and release GDI resources.
Definition at line 70 of file EditPlus.cpp.
void BIS_WTL_CONTROLS::CEditPlus::SetBackColor | ( | COLORREF | value | ) |
Select a new background color used when the control does not have focus.
value | The new non-focused background color. |
void |
Definition at line 100 of file EditPlus.cpp.
COLORREF BIS_WTL_CONTROLS::CEditPlus::GetBackColor | ( | ) | const |
Default: COLOR_WINDOW
.
Returns the color used for the background when the countrol does not have focus.
COLORREF | The non-focused background color. |
Definition at line 86 of file EditPlus.cpp.
void BIS_WTL_CONTROLS::CEditPlus::SetTextColor | ( | COLORREF | value | ) |
Select a new text color used when the control does not have focus.
value | The new non-focused text color. |
void |
Definition at line 134 of file EditPlus.cpp.
COLORREF BIS_WTL_CONTROLS::CEditPlus::GetTextColor | ( | ) | const |
Default: COLOR_WINDOWTEXT
.
Returns the color used for text when the control does not have focus.
COLORREF | Non-focused text color. |
Definition at line 119 of file EditPlus.cpp.
void BIS_WTL_CONTROLS::CEditPlus::SetFocusedBackColor | ( | COLORREF | value | ) |
Select a new background color used when the control has focus.
value | The new focused background color. |
void |
Definition at line 162 of file EditPlus.cpp.
COLORREF BIS_WTL_CONTROLS::CEditPlus::GetFocusedBackColor | ( | ) | const |
Default: COLOR_WINDOW
.
The background color used when the control has focus.
COLORREF | Focused background color. |
Definition at line 148 of file EditPlus.cpp.
void BIS_WTL_CONTROLS::CEditPlus::SetFocusedTextColor | ( | COLORREF | value | ) |
Select a new text color used when the control has focus.
value | The new focused text color. |
void |
Definition at line 196 of file EditPlus.cpp.
COLORREF BIS_WTL_CONTROLS::CEditPlus::GetFocusedTextColor | ( | ) | const |
Default: CLR_RED
.
Returns the color used for text when the control has focus.
COLORREF | Focused text color. |
Definition at line 181 of file EditPlus.cpp.
void BIS_WTL_CONTROLS::CEditPlus::EnableFloatingPointMode | ( | bool | value | ) |
Change the Floating Point Mode state.
value | New bool state. |
void |
Definition at line 224 of file EditPlus.cpp.
bool BIS_WTL_CONTROLS::CEditPlus::IsFloatingPointModeEnabled | ( | ) | const |
Default: false
.
If true, only characters constituting floating point values will be included (including the base 10 exponential operator 'E').
Definition at line 209 of file EditPlus.cpp.
void BIS_WTL_CONTROLS::CEditPlus::EnableNotifyOnCR | ( | bool | value | ) |
Change the 'Notify on CR' state.
value | New bool state. |
Definition at line 253 of file EditPlus.cpp.
bool BIS_WTL_CONTROLS::CEditPlus::IsNotifyOnCREnabled | ( | ) | const |
Default: true
.
If true
, the control will send it's parent a 'WM_EDITP_EDIT_END' message (defined as WM_APP + 1011 in WTK_Controls.h) when the user hits the 'Enter' key (VK_RETURN) while the control has focus.
bool | The 'Notify on CR' state. state. |
Definition at line 240 of file EditPlus.cpp.